cmake_minimum_required(VERSION 3.0.2)
project(arduino_uart)

## Compile as C++11, supported in ROS Kinetic and newer
# add_compile_options(-std=c++11)
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
add_definitions(-std=c++11 -g -O1 -ftree-vectorize -march=native)

set(CMAKE_INSTALL_RPATH /usr/local/lib)
find_package(catkin REQUIRED COMPONENTS
  roscpp
  std_msgs
  serial
)

catkin_package(
  CATKIN_DEPENDS roscpp std_msgs serial
)

###########
## Build ##
###########

include_directories(${catkin_INCLUDE_DIRS})


add_executable(arduino_uart
  src/arduino_uart.cpp
)

# add_dependencies(arduino_uart ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

target_link_libraries(arduino_uart
  ${catkin_LIBRARIES}
)